﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyWebApp.Filter;

namespace MyWebApp.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ResultFilterController : Controller
    {

        /// <summary>
        /// 测试:调用返回JSON
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [MyResultFilter]//作用范围是操作过滤器级别
        public IActionResult Test()
        {
            return Json(new
            {
                Id = 008,
                Name = "Aliang",
                Age = 28
            });

        }
    }
}
